<template>
	<view>
		<view class="css-nav">
			<view class="css-nav-back" @click="handleBack">
				<image src="../../static/backimg.png" mode="aspectFit" style="width: 100%;height: 100%;"></image>
			</view>
			<view class="css-nav-title">
				订单查询
			</view>
		</view>
		<view class="css-list">
			<u-list @scrolltolower="scrolltolower">
				<u-list-item v-for="(item, index) in list" :key="item.orderNo">
					<view class="css-card">
						<view class="css-card-cell">
							<span style="font-weight: 500;">业务员：</span>
							{{ item.userName }}
						</view>
						<view class="css-card-cell">
							<span style="font-weight: 500;">创建时间：</span>
							{{ item.createTime }}
						</view>
						<view class="css-card-cell">
							<span style="font-weight: 500;">产品名：</span>
							{{ item.goodName }} | {{ item.productType }}
						</view>
						<view class="css-card-cell">
							<span style="font-weight: 500;">入网姓名：</span>
							{{ item.custName }}
						</view>
						<view class="css-card-cell">
							<span style="font-weight: 500;">入网身份证号：</span>
							{{ item.idenNr }}
						</view>
						<view class="css-card-cell">
							<span style="font-weight: 500;">收货电话：</span>
							{{ item.receiveMobile }}
						</view>
						<view class="css-card-cell">
							<span style="font-weight: 500;">收货地址：</span>
							{{ item.receiveAddress }}
						</view>
					</view>
				</u-list-item>
			</u-list>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: [],
				page: 1
			}
		},
		onShow() {
			this.scrolltolower();
		},
		methods: {
			scrolltolower() {
				var token = uni.getStorageSync('token');
				if (token) {

					const baseURL = getApp().globalData.baseURL; //  pro_gdapp_h5

					var header = {};
					header["Authorization"] = token;
					uni.request({
						url: baseURL + "/liantong/list",
						data: {
							pageSize: this.page,
							pageNum: "10"
						},
						header: header,
						success: (res) => {
							console.log(res);
							if (this.page == 1) {
								this.list = [];
							}
							this.list = this.list.concat(res.data.rows);
							this.page += 1;
						}
					});
				} else {
					uni.reLaunch({
						url: "/pages/login/login"
					});
				}
			},
			handleBack() {
				uni.navigateBack()
			}
		}
	}
</script>

<style lang="scss" scoped>
	.css-card {
		width: calc(100% - 30px);
		margin-left: 15px;
		padding: 20px;
		margin-top: 15px;
		background-color: #fff;
		border-radius: 8px;
		background: #dde1e7;
		box-shadow: -3px -3px 7px #ffffff73,
			2px 2px 5px rgba(94, 104, 121, 0.288);

		.css-card-cell {
			width: 100%;
			display: flex;
			justify-content: space-between;
			color: #333;
			line-height: 30px;
			font-weight: 600;
		}
	}

	.css-list {
		padding-top: 64px;
	}

	.css-nav {
		position: fixed;
		top: 0;
		left: 0;
		width: 100%;
		height: 64px;
		background-color: #D72743;
		padding: 0 20px;
		display: flex;
		justify-content: flex-start;
		z-index: 999;

		.css-nav-back {
			height: 64px;
			width: 34px;
			padding: 20px 0;
		}

		.css-nav-title {
			height: 64px;
			line-height: 64px;
			text-align: center;
			width: calc(100% - 74px);
			color: #fff;
			font-size: 18px;
			font-weight: 500;
		}
	}
</style>